import React,{Component} from 'react'
import  reqUserlist from '../../api'
import {Table} from 'antd'
// import './home.scss'
/**
 * 用户管理
 */
export default  class User extends Component{
    constructor(props){
            super(props);
            this.state={
                list:[]

            }
    }

    componentDidMount(){

    }
    //请求列表
    reqUserlist= async (Id)=>{
        this.setState({loading:true}) //设置加载中动画状态显示

    }
    render(){
        const columns = [{
            title: 'id',
            dataIndex: 'id'
          }, {
            title: '用户名',
            dataIndex: 'username'
          }, {
            title: '性别',
            dataIndex: 'sex',
            render(sex){
                // eslint-disable-next-line
                return sex ==1 ?'男':'女'
            }
          }, {
            title: '昵称',
            dataIndex: 'state',
            render(state){
                let config = {
                    '1':'咸鱼一条',
                    '2':'风华浪子',
                    '3':'北大才子一枚',
                    '4':'百度FE',
                    '5':'创业者'
                }
                return config[state];
            }
          },{
            title: '爱好',
            dataIndex: 'interest',
            render(interest){
                let config = {
                    '1':'游泳',
                    '2':'打篮球',
                    '3':'踢足球',
                    '4':'跑步',
                    '5':'爬山',
                    '6':'骑行',
                    '7':'桌球',
                    '8':'麦霸'
                }
                return config[interest];
            }
          },{
            title: '婚否',
            dataIndex: 'isMarried',
            render(isMarried){
                return isMarried?'已婚':'未婚'
            }
          },{
            title: '生日',
            dataIndex: 'birthday'
          },{
            title: '联系地址',
            dataIndex: 'address'
          }
        ];
        return(
            <div className="usercontaint">
                <Table
                //  dataSource={list} 
                 columns={columns} />;

            </div>
        )
    }
}